Now we are in the second exercise session. Non-flat files were promised, so please load the GESIS Panel COVID-19 survey data.

This first part of the exercises only deals with importing data. Later, in the second part, we will turn to labelling and exporting.

1

Load the GESIS Panel COVID-19 survey data.
You can either load the SPSS or Stata file. In both cases, you need the haven package.

In contrast to the flat files, such as CSV, the variables now have labels.

2

Print the labels of the first ten variables in the dataset.
You can print labels with the function sjlabelled::get_label(your_data), but you have to make sure only to print the first ten variables.

Unfortunately, it’s all in German. Imagine you are an education researcher, and you are interested in the variable education_cat. So you may want to consider translating the variable into English.

3

Change the variable label of education_cat from “Bildung, kategorisiert” to “Education, categorized”.
There a two ways: You can either use the function sjlabelled::set_label() or do it in a pipe with sjlabelled::var_labels().

Your colleague asks you to provide your new data after changing labels and stuff. Unfortunately, she does not use R or SPSS and asks you to export your data as a Stata file.

4

Export your data as a Stata file.
As in the case of importing you, again, need the haven package.